/** 绘制损失率 **/
const drawChartBatchAllLoss = (data) => {
    const myChart = echarts.init(document.querySelector('#chartBatchAllLoss'));

    myChart.setOption({
        title: {
            text: 'chartBatchAllLoss'
        },
        tooltip: {
            trigger: 'axis',
        },
        // legend: {
        //     data: legendData
        // },
        xAxis: {
            type: 'category',
            data: data.allBatch.map((item, index) => index)
        },
        yAxis: {
            type: 'value'
        },
        series: {
            data: data.allBatch.map(dItem => dItem.loss),
            showSymbol: false,
            type: 'line'
        }
    })
}

/** 绘制 -  **/
const drawChartBatchAllAcc = (data) => {
    const myChart = echarts.init(document.querySelector('#chartBatchAllAcc'));

    console.log(`[data]:`, data);
    console.log(data.batch[0].batchData.map(item => item.batch));


    myChart.setOption({
        title: {
            text: 'chartBatchAllAcc'
        },
        tooltip: {
            trigger: 'axis',
        },
        // legend: {
        //     data: legendData
        // },
        xAxis: {
            type: 'category',
            data: data.allBatch.map((item, index) => index)
        },
        yAxis: {
            type: 'value'
        },
        series: {
            data: data.allBatch.map(dItem => dItem.acc),
            showSymbol: false,
            type: 'line'
        }
    })
}
